<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * LiteCommerce
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to licensing@litecommerce.com so we can send you a copy immediately.
 *
 * @category   LiteCommerce
 * @package    XLite
 * @subpackage Model_Proxy
 * @author     Creative Development LLC <info@cdev.ru>
 * @copyright  Copyright (c) 2011 Creative Development LLC <info@cdev.ru>. All rights reserved
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 * @link       http://www.litecommerce.com/
 * @see        ____file_see____
 * @since      1.0.0
 */

namespace XLite\Model\Proxy;

/**
 * THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE
 *
 * @package    XLite
 * @see        ____class_see____
 * @since      1.0.0
 */
class XLiteModelShippingMarkupProxy extends \XLite\Model\Shipping\Markup implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * _entityClass
     *
     * @var    string
     * @access protected
     * @see    ____var_see____
     * @since  1.0.0
     */
    protected $_entityClass;

    /**
     * _entityPersister
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_entityPersister;

    /**
     * _identifier
     *
     * @var    mixed
     * @access private
     * @see    ____var_see____
     * @since  1.0.0
     */
    private $_identifier;

    /**
     * __isInitialized__
     *
     * @var    mixed
     * @access public
     * @see    ____var_see____
     * @since  1.0.0
     */
    public $__isInitialized__ = false;

    /**
     * __construct
     *
     * @param mixed $entityPersister ____param_comment____
     * @param mixed $identifier      ____param_comment____
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __construct($entityPersister, $identifier)
    {
        $this->_entityPersister = $entityPersister;
        $this->_identifier = $identifier;
        $this->_entityClass = 'XLite\Model\Shipping\Markup';
    }

    /**
     * _load
     *
     * @return void
     * @access private
     * @see    ____func_see____
     * @since  1.0.0
     */
    private function _load()
    {
        if (!$this->__isInitialized__ && $this->_entityPersister) {
            $this->__isInitialized__ = true;
            if ($this->_entityPersister->load($this->_identifier, $this) === null) {
                return;
            }
            unset($this->_entityPersister);
            unset($this->_identifier);
        }
    }

    
    public function getMarkupValue()
    {
        $this->_load();
        return parent::getMarkupValue();
    }

    public function setMarkupValue($value)
    {
        $this->_load();
        return parent::setMarkupValue($value);
    }

    public function getMarkupId()
    {
        $this->_load();
        return parent::getMarkupId();
    }

    public function setMinWeight($minWeight)
    {
        $this->_load();
        return parent::setMinWeight($minWeight);
    }

    public function getMinWeight()
    {
        $this->_load();
        return parent::getMinWeight();
    }

    public function setMaxWeight($maxWeight)
    {
        $this->_load();
        return parent::setMaxWeight($maxWeight);
    }

    public function getMaxWeight()
    {
        $this->_load();
        return parent::getMaxWeight();
    }

    public function setMinTotal($minTotal)
    {
        $this->_load();
        return parent::setMinTotal($minTotal);
    }

    public function getMinTotal()
    {
        $this->_load();
        return parent::getMinTotal();
    }

    public function setMaxTotal($maxTotal)
    {
        $this->_load();
        return parent::setMaxTotal($maxTotal);
    }

    public function getMaxTotal()
    {
        $this->_load();
        return parent::getMaxTotal();
    }

    public function setMinItems($minItems)
    {
        $this->_load();
        return parent::setMinItems($minItems);
    }

    public function getMinItems()
    {
        $this->_load();
        return parent::getMinItems();
    }

    public function setMaxItems($maxItems)
    {
        $this->_load();
        return parent::setMaxItems($maxItems);
    }

    public function getMaxItems()
    {
        $this->_load();
        return parent::getMaxItems();
    }

    public function setMarkupFlat($markupFlat)
    {
        $this->_load();
        return parent::setMarkupFlat($markupFlat);
    }

    public function getMarkupFlat()
    {
        $this->_load();
        return parent::getMarkupFlat();
    }

    public function setMarkupPercent($markupPercent)
    {
        $this->_load();
        return parent::setMarkupPercent($markupPercent);
    }

    public function getMarkupPercent()
    {
        $this->_load();
        return parent::getMarkupPercent();
    }

    public function setMarkupPerItem($markupPerItem)
    {
        $this->_load();
        return parent::setMarkupPerItem($markupPerItem);
    }

    public function getMarkupPerItem()
    {
        $this->_load();
        return parent::getMarkupPerItem();
    }

    public function setMarkupPerWeight($markupPerWeight)
    {
        $this->_load();
        return parent::setMarkupPerWeight($markupPerWeight);
    }

    public function getMarkupPerWeight()
    {
        $this->_load();
        return parent::getMarkupPerWeight();
    }

    public function setShippingMethod(\XLite\Model\Shipping\Method $shippingMethod)
    {
        $this->_load();
        return parent::setShippingMethod($shippingMethod);
    }

    public function getShippingMethod()
    {
        $this->_load();
        return parent::getShippingMethod();
    }

    public function setZone(\XLite\Model\Zone $zone)
    {
        $this->_load();
        return parent::setZone($zone);
    }

    public function getZone()
    {
        $this->_load();
        return parent::getZone();
    }

    public function map(array $data)
    {
        $this->_load();
        return parent::map($data);
    }

    public function __get($name)
    {
        $this->_load();
        return parent::__get($name);
    }

    public function __set($name, $value)
    {
        $this->_load();
        return parent::__set($name, $value);
    }

    public function __unset($name)
    {
        $this->_load();
        return parent::__unset($name);
    }

    public function getRepository()
    {
        $this->_load();
        return parent::getRepository();
    }

    public function checkCache()
    {
        $this->_load();
        return parent::checkCache();
    }

    public function detach()
    {
        $this->_load();
        return parent::detach();
    }

    public function __call($method, array $args = array (
))
    {
        $this->_load();
        return parent::__call($method, $args);
    }

    public function isPersistent()
    {
        $this->_load();
        return parent::isPersistent();
    }

    public function update()
    {
        $this->_load();
        return parent::update();
    }

    public function create()
    {
        $this->_load();
        return parent::create();
    }

    public function delete()
    {
        $this->_load();
        return parent::delete();
    }

    public function cloneEntity()
    {
        $this->_load();
        return parent::cloneEntity();
    }

    public function prepareEntityBeforeCommit()
    {
        $this->_load();
        return parent::prepareEntityBeforeCommit();
    }


    /**
     * __sleep
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __sleep()
    {
        return array('__isInitialized__', 'markup_id', 'min_weight', 'max_weight', 'min_total', 'max_total', 'min_items', 'max_items', 'markup_flat', 'markup_percent', 'markup_per_item', 'markup_per_weight', 'shipping_method', 'zone');
    }

    /**
     * __wakeup
     *
     * @return void
     * @access public
     * @see    ____func_see____
     * @since  1.0.0
     */
    public function __wakeup()
    {
        if (isset($this->_identifier)) {
            foreach ($this->_identifier as $k => $v) {
                $this->$k = $v;
            }

            \Xlite\Core\Database::getEM()->getUnitOfWork()->removeFromIdentityMap($this);
            $this->_entityPersister = \XLite\Core\Database::getEM()->getUnitOfWork()->getEntityPersister($this->_entityClass);
        }
    }
}